<%--
 *  File:    MDSnapShotMain.jsp
 *  @Author: TerryCui
 *  Date:    2011/01/25
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%
  //init param
  String strModuleName = "IMG";
  String privilegeCode = "Z0834";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/NewCalendar.inc" %>

<head>
<title>MDSnapShotMain</title>

<PageFlow:CheckPageFlow pageName="p_mdsnapshotmain"></PageFlow:CheckPageFlow>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>

<script type="text/javascript">
function page_save(){
	if(!checkForm(cform)) return;
	document.cform.actionname.value="save";
	document.cform.target="_self"
	isRunning = true;
	document.cform.submit();
}
function page_back(){
	self.location.href="MDSnapShotSummary.jsp?<%= OvalTools.randomURL() %>";
}
</script>
</head>
<%  
	HashMap mdsnapshotinfo=(HashMap)pageContext.getAttribute("mdsnapshotinfo");
	if(mdsnapshotinfo==null)
		mdsnapshotinfo=new HashMap();
	
	boolean isReadOnly=false;
	if(mdsnapshotinfo.get("mdsnapshotid")!=null){
		isReadOnly=true;
	}
	String IsNeed = isReadOnly?"td-text":"need";
	String IsNeed2 = "need";
	if(isView){
		IsNeed2 = "td-text";
	}
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" >
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
       <input type="hidden" name="pagename" value="p_mdsnapshotmain">
       <input type="hidden" name="actionname">
       <custom:hidden name="mdsnapshotinfo" property="mdsnapshotid"></custom:hidden>
  <tr> 
    <td valign="top"> 
        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="1">
          <tr> 
            <td colspan="4" class="deepblue-left"> <img src="<%=contextPath%>/images/<%= strLanguageCode %>/quote.gif"> 
              <%= label.getLabelName("L_BasicInfo") + label.getLabelName("L_Colon") %> </td>
          </tr>
          
          <tr> 
            <td class="<%=IsNeed%>"><%= label.getLabelName("L_SnapShotCode") + label.getLabelName("L_Colon") %></td>
            <td>
            	<%if(isReadOnly){%>
            		<custom:write name="mdsnapshotinfo" property="mdsnapshotcode" nbsp="true"/>
            	<%}else{%>
            		<custom:text name="mdsnapshotinfo" property="mdsnapshotcode" command="notnull" label="L_SnapShotCode"/>
            	<%}%>
            </td>
            <td class="<%=IsNeed%>"><%= label.getLabelName("L_SnapShotName") + label.getLabelName("L_Colon") %></td>
            <td>
            	<%if(isReadOnly){%>
            		<custom:write name="mdsnapshotinfo" property="mdsnapshotname" nbsp="true"/>
            	<%}else{%>
                	<custom:text name="mdsnapshotinfo" property="mdsnapshotname" command="notnull" label="L_SnapShotName"/>
                <%}%>
            </td>
          </tr>
          <tr> 
            <td class="<%=IsNeed%>"><%= label.getLabelName("L_MasterData") + label.getLabelName("L_Colon") %></td>
            <td>
            	<%if(isReadOnly){%>
            		<custom:write name="mdsnapshotinfo" property="masterdata" nbsp="true" dictType="MDSnapShot"/>
            		<custom:hidden name="mdsnapshotinfo" property="masterdata"/>
            	<%}else{%>
            		<custom:selectdic name="mdsnapshotinfo" property="masterdata" command="notnull" label="L_MasterData" dictType="MDSnapShot" defaultValue="------------" defaultValueCost=""/>
            	<%}%>
            </td>
            <td class="td-text"><%= label.getLabelName("L_MasterDataFilter") + label.getLabelName("L_Colon") %></td>
            <td>
            	<custom:select name="mdsnapshotinfo" property="mdfilter" optionsName="allmdfilters" optionValueKey="advancedfilterid" optionInnerTextKey="filtername" defaultValue="---------------------------" defaultValueCost=" "/>
            </td>
          </tr>
          <tr> 
            <td class="<%=IsNeed2%>"><%= label.getLabelName("L_RunCycle") + label.getLabelName("L_Colon") %></td>
            <td> 
            	<custom:selectdic name="mdsnapshotinfo" command="notnull" label="L_RunCycle" property="runcycleid" dictType="RunCycle" defaultValue="------------" defaultValueCost=""/>
            </td>
            <td class="<%=IsNeed2%>"><%= label.getLabelName("L_NextRunTime") + label.getLabelName("L_Colon") %></td>
            <td> 
				<custom:text name="mdsnapshotinfo" property="runtime" command="notnull" label="L_NextRunTime" dataType="date" dataFormatName="dateformat"/>
				<a onclick="javascript:c.show(this,'cform.runtime','<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>');">
				<custom:button type="3" label="L_Asterisk"	imgsrc="../../../images/cn/Time.gif" border="0" /></a>
            </td>
          </tr>
          <tr> 
            <td class="<%=IsNeed2%>"><%= label.getLabelName("L_Status") + label.getLabelName("L_Colon") %></td>
            <td colspan="3"> 
            	<custom:selectdic name="mdsnapshotinfo" property="status" dictType="Status" valueCriteria="28,41" defaultValue="------------" defaultValueCost=""/>
            </td>
          </tr>
          <tr>
            <td class="td-text"><%= label.getLabelName("L_Description") + label.getLabelName("L_Colon") %></td>
            <td colspan="3">
            	<custom:text name="mdsnapshotinfo" property="description" size="50"/>
            </td>
          </tr>
        </table>
      </td>
  </tr>
  <tr>
    <td class="summary_top"></td>
  </tr>
  <tr> 
      <td height="49" class="td_center">
      <%if(!isView){%>
      	<a onclick="page_save()"><custom:button type="1" label="L_Save" border="0" style="width:60"/></a>
      <%}%>
      <a onclick="page_back()"><custom:button type="1" label="L_Back" border="0" style="width:60"/></a>
      </td>
  </tr>
</form>
</table>

</body>
</html>